import java.awt.Image;
import java.io.Serializable;

/**
 * represents a property in a M.U.L.E. game
 * @author Sherman Mathews && Megan Beebe
 *
 */
public class Property implements Serializable {
	private int terrain;	//the code for the terrain type
	/*terrain types -- 1: plain, 2: mountain one, 3: mountain two, 4: mountain three, 5. river, 6: town*/
	private Mule mule;		//the mule on the property	
	private boolean hasMule;	//if the property has a mule
	private Player owner;	//the owner of the property
	private int value;		//how much the property is worth
	private Image image;	//the image that represents the property
	
	/**
	 * creates an instance of a property in a M.U.L.E. game
	 * @param terrain the type of terrain
	 */
	public Property(int terrain){//might change these; MEGAN: took out "int value" I have no idea what is was for.
		this.terrain = terrain;
		hasMule = false;
	}

	/**
	 * gets the type of terrain
	 * @return the number of the terrain type
	 */
	public int getTerrainNum() {
		return terrain;
	}
	
	/**
	 * gets the terrain type
	 * @return the string representing the terrain type
	 */
	public String getTerrainType() {
		if(terrain == 1)
			return "Plain";
		if (terrain == 2)
			return "Mountain One";
		if (terrain == 3)
			return "Mountain Two";
		if (terrain == 4)
			return "Mountain Three";
		if (terrain == 5)
			return "River";
		else
			return "Town";
	}

	/**
	 * gets the mule on the property
	 * @return the mule on the property
	 */
	public Mule getMule() {
		return mule;
	}

	/**
	 * sets the mule on the property
	 * @param mule the mule to be set
	 */
	public void setMule(Mule mule) {
		this.mule = mule;
	}

	/**
	 * determines if the property has a mule
	 * @return true if property has a mule, false otherwise
	 */
	public boolean hasMule() {
		return hasMule;
	}

	/**
	 * sets if the property has a mule
	 * @param hasMule whether or not the property has a mule
	 */
	public void setHasMule(boolean hasMule) {
		this.hasMule = hasMule;
	}

	/**
	 * gets the property's owner
	 * @return the player that owns the property
	 */
	public Player getOwner() {
		return owner;
	}
	
	/**
	 * sets the property's owner
	 * @param the player that owns the property
	 */
	public void setOwner(Player owner) {
		this.owner = owner;
	}

	/**
	 * gets the value of the property
	 * @return the value of the property
	 */
	public int getValue() {
		return value;
	}

	/**
	 * sets the value of the property
	 * @param how much the property is worth
	 */
	public void setValue(int value) {
		this.value = value;
	}
}
